<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet"
	href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<title>Company creation</title>
</head>
<body>
<div class="container">
	<h1>Add new criteria</h1>
	<form:form method="POST" commandName="criteria"
		action="${pageContext.request.contextPath}/criteria/create">
		<table>
			<tbody>
				<tr>
					<td>Criteria name:</td>
					<td><form:input path="name" /></td>
					<td><form:errors path="name" cssStyle="color: red;" /></td>
				</tr>
				<tr>
					<td>Firm:</td>
					<td><form:select path="firm" >
							<c:forEach var="firm" items="${firms }">
								<form:option  value="${firm.name }">${firm.name }</form:option>
							</c:forEach>
								
							
						</form:select></td>
					<td><form:errors path="firm" cssStyle="color: red;" /></td>
				</tr>
				<tr>
					<td>Term:</td>
					<td><form:select path="term">
								<c:forEach var="term" items="${terms }">
									<form:option  value="${term.name }"/>
								</c:forEach>
						</form:select></td>
					<td><form:errors path="term" cssStyle="color: red;" /></td>
				</tr>
				<tr>
					<td>Group:</td>
					<td><form:select path="group">
								<c:forEach var="group" items="${groups }">
									<form:option  value="${group.name }"/>
								</c:forEach>
						</form:select></td>
					<td><form:errors path="group" cssStyle="color: red;" /></td>
				</tr>
				
				<tr>
					<td>Status:</td>
					<td><form:select path="status">
							<form:options items="${status}" />
						</form:select></td>
					<td><form:errors path="status" cssStyle="color: red;" /></td>
				</tr>

				<tr>
					<td><input type="submit" value="Add Criteria" /></td>
					<td></td>
					<td></td>
				</tr>
			</tbody>
		</table>
	</form:form>
	<a href="${pageContext.request.contextPath}/">Home</a>
</div>
</body>
</html>